package com.mg.yygh.task.scheduled;

import com.mg.common.rabbit.constant.MqConst;
import com.mg.common.rabbit.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author M_Dragon
 * @date 2023/01/12 17:06
 */
@Component
@EnableScheduling
public class scheduledTask {
    @Autowired
    private RabbitService rabbitService;

    // 就医提醒，每天8点执行方法
    @Scheduled(cron = "0 0 8 * * ?")
    public void treatmentTask(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"");
    }
}
